﻿CREATE PROCEDURE [dbo].[ETL_SP_GetSummary4TaskCount]
AS
/*
            public const int Timer = 0x01;
            public const int Alarm = 0x02;
            public const int Manual = 0x03;
            public const int Event = 0x04;*/
select
(select COUNT(T.id) from ETL_Task as T) as Total,
(select COUNT(T.id) from ETL_Task as T where T.RunMode=1) as [Timer],
(select COUNT(T.id) from ETL_Task as T where T.RunMode=2) as [Alarm],
(select COUNT(T.id) from ETL_Task as T where T.RunMode=3) as [Manual],
(select COUNT(T.id) from ETL_Task as T where T.RunMode=4) as [Event]